package org.yzh.web.response;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.yzh.web.entity.ElectronicFence;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
@Data
public class ElectronicFencePageSearchResponse implements Serializable {


    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 创建者
     */

    @Schema(description = "创建者")
    private String createBy;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime gmtCreate;

    /**
     * 开始时间
     */
    @Schema(description = "开始时间")
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @Schema(description = "结束时间")
    private LocalDateTime endTime;

    /**
     * 修改者
     */
    @Schema(description = "修改者")
    private String modifiedBy;

    /**
     * 修改时间
     */
    @Schema(description = "修改时间")
    private LocalDateTime gmtModified;

    /**
     * 1表示存在 0表示删除
     */
    @Schema(description = "1表示存在 0表示删除")
    private Integer isValid;

    /**
     * 扩展字段
     */
    @Schema(description = "扩展字段")
    private String extJson;

    /**
     * 围栏名称
     */
    @Schema(description = "围栏名称")
    private String fenceName;

    /**
     * 围栏类型
     */
    @Schema(description = "围栏类型")
    private String fenceType;

    /**
     * 围栏等级
     */
    @Schema(description = "围栏等级")
    private Integer grade;

    /**
     * 围栏颜色
     */
    @Schema(description = "围栏颜色")
    private String color;

    /**
     * 序号
     */
    @Schema(description = "序号")
    private Integer serialNumber;

    public static ElectronicFencePageSearchResponse convert(ElectronicFence detail) {
        ElectronicFencePageSearchResponse response = new ElectronicFencePageSearchResponse();
        BeanUtils.copyProperties(detail,response);
        return response;
    }
}
